import java.sql.SQLOutput;
import java.text.BreakIterator;

class Animoal{
    String name;
    int age;
    public Animoal(int age,String name){
        this.age=age;
        this.name=name;
    }
   /* public void A(){
        System.out.println("年龄:"+age+" "+"名字:"+name);
    }*/
    public void Break(){
        System.out.println("动物叫");
    }
    public void Eat(){
        System.out.println("动物吃饭");
    }
}
class Cat extends Animoal{
    public Cat(){
        super(12,"x");
    }
    public void Break(){
        System.out.println(name+"喵喵叫");
    }
   /* public void A(){
        System.out.println("年龄:"+age+" "+"名字:"+name);
    }*/
    @Override
    public void Eat() {
        System.out.println(name+"吃猫粮");
    }
}
class Dog extends Animoal{
    public Dog(){
        super(1,"p");
    }
    public void Break(){
        System.out.println(name+"汪汪叫");
    }
    /* public void A(){
         System.out.println("年龄:"+age+" "+"名字:"+name);
     }*/
    @Override
    public void Eat() {
        System.out.println(name+"吃狗粮");
    }
}
/*class Break extends Animoal{
    public void Break(){
        System.out.println("喵喵叫");
    }
}
class Break1 extends Animoal{
    public void Break(){
        System.out.println("汪汪叫");
    }
}*/
public class Main {
    public static void main(String[] args) {
    Cat cat=new Cat();
    cat.Eat();
    func(cat);
        Dog dog=new Dog();
        dog.Eat();
        func(dog);
   /* cat.A();*/
   /* func(new Break());
    func(new Break1());*/
    }
    public static void func(Animoal animoal){
    animoal.Eat();
    animoal.Break();
    }
}
